﻿#ifndef NSSHARE_PLATFORM_H_
#define NSSHARE_PLATFORM_H_

//Toolchain Detection
#if defined(_MSC_VER)

//OS Dectection
//MSVC toolchain already imply the target OS
#define NSSHARE_WINDOWS

//Platform Detection
#if defined(_M_IX86)
#define NSSHARE_X86
#elif !defined(_M_X64)
#define NSSHARE_X64
#else
#error Unspported Platform
#endif

//Configuration Detection
#if defined(NDEBUG)
#define NSSHARE_RELEASE
#elif defined(_DEBUG)
#define NSSHARE_DEBUG
#else
#error Guess Configuration Failed
#endif

#else
#error Unspported OS
#endif

#if defined NSSHARE_WINDOWS

#define NOMINMAX
#include <winsock2.h>
//avoiding conflicit with winsock.h
#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif
#include <windows.h>
#include <dwmapi.h>
#include <windowsx.h>
#include <ws2tcpip.h>
#include <mswsock.h>
#include <shlobj.h>
#include <aclapi.h>
#include <accctrl.h>
#include <sddl.h>
#elif defined NSSHARE_MACOS

#endif

#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <stdarg.h>
#include <process.h>
#include <string>
#include <memory>
#include <vector>
#include <list>
#include <algorithm>
#include <map>

#if defined NSSHARE_WINDOWS
const size_t kMaxPath = 264;
#endif

#endif